#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "Action.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class Classifier;
class InputPin;
class OutputPin;

/// <summary>
/// UnmarshallAction
/// An UnmarshallAction is an Action that retrieves the values of the
/// StructuralFeatures of an object and places them on OutputPins. 
/// </summary>
class UMLMODEL_EXPORT UnmarshallAction : public Action {

public: // Constructors and destructors
    explicit UnmarshallAction(const QString& umlType="uml::UnmarshallAction");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// object getter
    /// The InputPin that gives the object to be unmarshalled.
    /// </summary>
    shared_ptr<InputPin> object() const;

    /// <summary>
    /// object setter
    /// The InputPin that gives the object to be unmarshalled.
    /// </summary>
    void setObject(shared_ptr<InputPin> value);

    /// <summary>
    /// results getter
    /// The OutputPins on which are placed the values of the StructuralFeatures of the
    /// input object.
    /// </summary>
    vector<shared_ptr<OutputPin>>& results();

    /// <summary>
    /// unmarshallType getter
    /// The type of the object to be unmarshalled.
    /// </summary>
    shared_ptr<Classifier> unmarshallType() const;

    /// <summary>
    /// unmarshallType setter
    /// The type of the object to be unmarshalled.
    /// </summary>
    void setUnmarshallType(shared_ptr<Classifier> value);

private: // Fields
    /// <summary>
    /// object
    /// The InputPin that gives the object to be unmarshalled.
    /// </summary>
    shared_ptr<InputPin> object_;

    /// <summary>
    /// results
    /// The OutputPins on which are placed the values of the StructuralFeatures of the
    /// input object.
    /// </summary>
    vector<shared_ptr<OutputPin>> results_;

    /// <summary>
    /// unmarshallType
    /// The type of the object to be unmarshalled.
    /// </summary>
    shared_ptr<Classifier> unmarshallType_;

};

} // namespace uml
